package com.example.demo.repository;


import com.example.demo.entity.Chatroom;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface ChatroomRepository extends JpaRepository<Chatroom,Integer> {
    //@Query(value = "select * from chatroom where activity_id = :activity_id; ",nativeQuery = true)
    @Query(value = "select * from chatroom where activity_id = :activity_id",nativeQuery = true)
    List<Chatroom> findAllByActivityId(@Param("activity_id")int activity_id);
}
